package com.heima.utils.common;

import com.heima.model.user.pojos.ApUser;
import io.swagger.models.auth.In;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2023/3/16 10:12
 * @Version 1.0
 */
public class APUserThreadLocalUtil {


    private final static ThreadLocal<Integer> LOCAL = new ThreadLocal<>();

    public static void setUser(ApUser apUser){
        LOCAL.set(apUser.getId());
    }


    public static Integer getUser(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}